<!DOCTYPE html>
<html lang="en">

<head>
    <meta charset="UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0">
    <meta http-equiv="X-UA-Compatible" content="ie=edge">
    <link rel="stylesheet" href=" {{ url_for('static', filename='css/bootstrap.min.css', _external=True) }}">
    <link rel="icon shortcut" href="{{ url_for('static', filename='images/boat.ico', _external=True) }}"> {% block link_for_style %} {% endblock %}
    <link rel="stylesheet" href="{{ url_for('static', filename='css/base.css', _external=True) }}">
    <link rel="stylesheet" href="{{ url_for('static', filename='highlight/styles/github-gist.css', _external=True)}}">
    <script src="{{ url_for('static', filename='highlight/highlight.pack.js', _external=True)}}"></script>
    <script>
        hljs.initHighlightingOnLoad();
        function getTodayWeather() {
            document.getElementById("weather").innerHTML = Date();
        }
    </script>
    <script>(function(T,h,i,n,k,P,a,g,e){g=function(){P=h.createElement(i);a=h.getElementsByTagName(i)[0];P.src=k;P.charset="utf-8";P.async=1;a.parentNode.insertBefore(P,a)};T["ThinkPageWeatherWidgetObject"]=n;T[n]||(T[n]=function(){(T[n].q=T[n].q||[]).push(arguments)});T[n].l=+new Date();if(T.attachEvent){T.attachEvent("onload",g)}else{T.addEventListener("load",g,false)}}(window,document,"script","tpwidget","//widget.seniverse.com/widget/chameleon.js"))</script>
    <script>tpwidget("init", {
        "flavor": "bubble",
        "location": "WKJ1F428HH2F",
        "geolocation": "enabled",
        "position": "top-left",
        "margin": "53px 10px",
        "language": "zh-chs",
        "unit": "c",
        "theme": "white",
        "hash": "7de7c8608f7aa75cb332edc10601160d"
    });
    tpwidget("show");</script>
    <!--google ReCaptcha-->
    <!--<script src='https://www.google.com/recaptcha/api.js'></script>-->
    <!--<div class="g-recaptcha" data-sitekey="6LdcaTwUAAAAAAM5CBw2ab-bnJSnJbA_TG3Hs3rq"></div>-->
    <!--will be replace by the title-->
    <!--background: url('../../static/images/background.jpg');-->
    <title>{% block title %}Home{% endblock %}</title>
    <style>

    </style>
    <!--The macro must put in the head.-->
    <!-- Macro: `render paginate` -->
    {% macro render_pagination(pagination, endpoint) %}
    <nav aria-label="Page navigation">
        <div>
            <ul class="pagination">
                <!--<<-->
                <li>
                    {% if pagination.has_prev %}
                    <a href="{{ url_for('blog.home', page=pagination.prev().page)
                }}" aria-label="Previous">
            {% else %}
                <a href="{{ url_for('blog.home', page=1) }}" aria-label="Previous">
            {% endif %}
                <span aria-hidden="true">&laquo;</span>
                </a>
                </li>
                <!--Pagintion pages guide-->
                {% for page in pagination.iter_pages() %} {% if page %} {% if page != pagination.page %}
                <li>
                    <a href="{{ url_for(endpoint, page=page) }}"> {{ page }}
                            </a>
                </li>
                {% else %}
                <li><a href="#"> {{ page }} </a></li>
                {% endif %} {% else %}
                <li><a href="#"> ... </a></li>
                {% endif %} {% endfor %}

                <!--"\>\>"-->
                <li>
                    <a href="{{ url_for('blog.home', page=pagination.next().page )
                }}" aria-label="Next">
                <span aria-hidden="true">&raquo;</span>
                </a>
                    <li>
            </ul>
        </div>
    </nav>
    {% endmacro %} {% block captcha %} {% endblock %}
</head>

<body>

    <!--nav-->



    {% block navbar %}
    <!--nav bar-->
    <nav class="navbar navbar-inverse container">
        <div class="navbar-header">
            <button class="navbar-toggle" type="button" data-toggle="collapse" data-target="#example-collapse-toggle">
                <span class="sr-only">切换导航</span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
                <span class="icon-bar"></span>
            </button>
            <!--<a class="navbar-brand" href="{{ url_for('blog.home', page=1) }}">Sai的博客</a>-->
        </div>

        <div class="collapse navbar-collapse" id="example-collapse-toggle">
            <ul class="nav navbar-nav">
                <!--logout btn-->
                <li>
                    <a href="{{url_for('blog.home')}}">
                        <span class="glyphicon glyphicon-home"></span>
                    </a>
                </li>
                {% if current_user.is_authenticated %}
                <li><a class="btn" href="{{ url_for('main.logout') }}">Logout</a></li>
                <li style="display:inline-block;">
                    <a href="{{ url_for('blog.new_post') }}" class="btn btn-sm">New Post</a>
                </li>
                {% else %}
                <!--
                <li><a href="{{ url_for('main.register') }}">Register</a></li>
                -->
                <li><a href="{{ url_for('main.login')}}">Login</a></li>
                {% endif %}
                <!--<li><a href="">1</a></li>-->
                <li class="dropdown">
                    <a href="" class="dropdown-toggle" data-toggle="dropdown">
                        <span class="glyphicon glyphicon-user"></span>
                        <b class="caret"></b>
                    </a>
                    <ul class="dropdown-menu">
                        <li class="divider"></li>
                        <li class="dropdwon-header">生活信息</li>
                        <li><a>1.1</a></li>
                        <li><a>1.2</a></li>
                        <li><a>1.3</a></li>
                        <li><a>1.4</a></li>
                        <li>
                            <p id="weather">今天天气</p>
                        </li>
                        <button type="button" onclick="getTodayWeather()"></button>
                        <li class="divider"></li>
                        <li class="dropdown-header">个人信息</li>
                        <li><a>2.1</a></li>
                        <li><a>2.2</a></li>
                        <li><a>2.3</a></li>
                    </ul>
                </li>
            </ul>
        </div>

    </nav>
    {% endblock %}

    <div class="container">
        <div class="page-header">
            <p></p>
            <h1><a href="{{ url_for('blog.home') }}"></a></h1>
            <p>Welcome !</p>
        </div>
        <!--flash messages-->
        {% for message in get_flashed_messages() %}
        <div class="alert alert-info slert-dismissible" role="alert">
            <button type="button" class="close" data-dismiss="alert">
                <span aria-hidden="true">&times;</span>
                <span class="sr-only">关闭</span>
            </button> {{ message }}
        </div>
        {% endfor %}

        <!--body-->
        {% block body %} block_content {% endblock %}


    </div>

    <div>
        <div class="go-top" style="display:false;">
            <div class="arrow"></div>
            <div class="stick"></div>
        </div>
    </div>

    {% block footer %}
    <!--botton nav-->
    <div class="footer" align="center">
        <div class="seprator">
            <hr/>
            <br/>
        </div>
        <div class="container">
            <div class="copyleft">
                <a href="http://github.com/hzsai">&copy;hzsai</a> Drills From <a href="http://blog.csdn.net/jmilk">&copy;Jmilk</a>                <br/> Power by <a href="http://flask.pocoo.org">Flask</a> <br/>
            </div>
        </div>
    </div>
    {% endblock %}

    <script src="{{ url_for('static', filename='js/jquery-3.2.1.min.js', _external=True) }}"></script>
    <script src="{{ url_for('static', filename='js/bootstrap.min.js', _external=True) }}"></script>
    <script src="{{ url_for('static', filename='js/base.js', _external=True) }}"></script>
    <script type="text/javascript" src='https://cdnjs.cloudflare.com/ajax/libs/mathjax/2.7.2/MathJax.js?config=TeX-MML-AM_CHTML'></script>
    <script type="text/x-mathjax-config">
        var mathId = document.getElementsByClassName('card'); MathJax.Hub.Config({ showProcessingMessages: false, messageStyle: "none",
        extensions: ["tex2jax.js"], jax: ["input/TeX", "output/HTML-CSS"], tex2jax: { inlineMath: [ ["$", "$"] , ['\\(',
        '\\)']], displayMath: [ ["$$","$$"] ], skipTags: ['script', 'noscript', 'style', 'textarea','code','a'], ignoreClass:"comment-content"
        }, "HTML-CSS": { availableFonts: ["STIX","TeX"], showMathMenu: false } }); MathJax.Hub.Queue(["Typeset",MathJax.Hub,mathId]);
    </script>

    {% block link_for_script %} {% endblock %}
</body>

</html>
